#pragma once
#include "FastList.h"
#include <vector>
#include "ScrollHelper.h"
#include "StkDataUpdate.h"

// CStkListView
class CStkListView : public CFastList
{
	DECLARE_DYNAMIC(CStkListView)

public:
	CStkListView();
	virtual ~CStkListView();
	
public:
	void SetListData(stkupdate::StockList *pStkList, stkupdate::CStkDataUpdateMgr *pMgr);
	void InitScrollBar();

protected:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual void BeforeOnPaint(CDC *pDC,const CRect &rtClipBox);
	virtual void AfterOnPaint(CDC *pDC,const CRect &rtClipBox);

protected:
	DECLARE_MESSAGE_MAP()
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);

private:
	stkupdate::CStkDataUpdateMgr*	m_pMgr;
	stkupdate::StockList*			m_stklist;
	DWORD m_dwToken;
	CScrollHelper m_scroll;

public:
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
};


